package org.nbict.iot;

import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;

/**
 * Created by songseven on 18/6/22.
 */
public class DateUtil {

    private static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
    public static String toDate(Long timestamp) {
        LocalDateTime date = LocalDateTime.ofEpochSecond(timestamp, 0, ZoneOffset.of("+8"));
        return date.format(formatter);
    }
}
